﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace aier.dataaccess.model
{
    [XrmEntity("task", "activityid")]
    public class TaskInfo
    {
        private Guid activityid;
        private string subject;
        private int? new_type;
        private int? stateCode;
        private int? statuscode;
        private int? prioritycode;
        private int? new_status;
        private DateTime? scheduledStart;
        private DateTime? scheduledEnd;
        private string ownerId;
        private string description;
        private DateTime? actualStart;
        private DateTime? actualEnd;
        private string new_description;

        /// <summary>
        /// 任务ID
        /// </summary>
        [XrmFieldMapping("activityid", XrmAttributeType.UniqueIdentifier,true)]
        public Guid Activityid
        {
            get { return activityid; }
            set { activityid = value; }
        }

        /// <summary>
        /// 筛查主题
        /// </summary>
        [XrmFieldMapping("subject", XrmAttributeType.String, false)]
        public string Subject
        {
            get { return subject; }
            set { subject = value; }
        }

        /// <summary>
        /// 筛查类型
        /// 100000000:筛查通知
        /// 100000001:筛查回访
        /// </summary>
        [XrmFieldMapping("new_type", XrmAttributeType.Int, true)]
        public int? New_type
        {
            get { return new_type; }
            set { new_type = value; }
        }

        /// <summary>
        /// 活动状态,配合　状态描述
        /// 已启动：0
        /// 已完成：1　　　5
        /// 已完成：2      6
        /// </summary>
        [XrmFieldMapping("stateCode", XrmAttributeType.Int, true)]
        public int? StateCode
        {
            get { return stateCode; }
            set { stateCode = value; }
        }

        /// <summary>
        /// 状态描述 配合 活动状态
        /// 已完成：5      1
        /// 已取消：6      2
        /// </summary>
        [XrmFieldMapping("statuscode", XrmAttributeType.Int, true)]
        public int? Statuscode
        {
            get { return statuscode; }
            set { statuscode = value; }
        }

        /// <summary>
        /// 优先级
        /// 0:low
        /// 1:nomarl
        /// 2:high
        /// </summary>
        [XrmFieldMapping("prioritycode", XrmAttributeType.Int, true)]
        public int? PriorityCode
        {
            get { return prioritycode; }
            set { prioritycode = value; }
        }

        /// <summary>
        /// 通知状态
        /// 已通知：100000000
        /// 已查看：100000001
        /// </summary>
        [XrmFieldMapping("new_status", XrmAttributeType.Int, true)]
        public int? New_status
        {
            get { return new_status; }
            set { new_status = value; }
        }

        /// <summary>
        /// 计划开始时间
        /// </summary>
        [XrmFieldMapping("scheduledstart", XrmAttributeType.DateTime, true)]
        public DateTime? ScheduledStart
        {
            get { return scheduledStart; }
            set { scheduledStart = value; }
        }

        /// <summary>
        /// 计划结束时间
        /// </summary>
        [XrmFieldMapping("scheduledend", XrmAttributeType.DateTime, true)]
        public DateTime? ScheduledEnd
        {
            get { return scheduledEnd; }
            set { scheduledEnd = value; }
        }

        /// <summary>
        /// 负责人ID
        /// </summary>
        [XrmFieldMapping("ownerId", XrmAttributeType.EntityReference, true)]
        [XrmReferenceType("systemuser", default(string))]
        public string OwnerId
        {
            get { return ownerId; }
            set { ownerId = value; }
        }

        /// <summary>
        /// 任务说明
        /// </summary>
        [XrmFieldMapping("description", XrmAttributeType.String, false)]
        public string Description
        {
            get { return description; }
            set { description = value; }
        }

        /// <summary>
        /// 实际开始时间
        /// </summary>
        [XrmFieldMapping("actualstart", XrmAttributeType.DateTime, true)]
        public DateTime? ActualStart
        {
            get { return actualStart; }
            set { actualStart = value; }
        }

        /// <summary>
        /// 实际结束时间
        /// </summary>
        [XrmFieldMapping("actualend", XrmAttributeType.DateTime, true)]
        public DateTime? ActualEnd
        {
            get { return actualEnd; }
            set { actualEnd = value; }
        }

        /// <summary>
        /// 完成情况
        /// </summary>
        [XrmFieldMapping("new_description", XrmAttributeType.String, false)]
        public string New_description
        {
            get { return new_description; }
            set { new_description = value; }
        }
    }
}
